<template>
	<!-- 历史记账页 -->
	<view class="wrap back" style="padding-top: 20rpx;height: 100%;padding: 30rpx;">
		<text class="text30 fontWeight">当前累计积分明细:</text>
		<view class="text28 " style="margin-top: 30rpx;display: flex;flex-direction: column;">
			<text class="fontWeight" style="margin-bottom: 20rpx;">调研所得积分：<text style="color:f6f6f6;font-weight: bold;">{{wenjuan_score==null?0:wenjuan_score}} 分</text> </text>
			<text class="fontWeight" style="margin-bottom: 20rpx;">记账所得积分：<text style="color:f6f6f6;font-weight: bold;">{{jizhang_score==null?0:jizhang_score}}  分</text></text>
			<text class="fontWeight" style="margin-bottom: 20rpx;">意见反馈积分：<text style="color:f6f6f6;font-weight: bold;">{{feedback_score==null?0:feedback_score}}  分</text></text>
			<text class="fontWeight" style="margin-bottom: 20rpx;">个人登录积分：<text style="color:f6f6f6;font-weight: bold;">{{login_score==null?0:login_score}}  分</text></text>
		</view>
	</view>
</template>

<script>
	import util from '../../../utils/util.js';
	export default {
		data() {
			return {
				// 记账列表数据
				billListData: [],
				//  用户手机号
				phone: '',
				jizhang_score: null, //记账积分
				wenjuan_score: null, //问卷积分
				feedback_score: null, //意见反馈积分
				login_score: null
			};
		},
		onLoad(options) {
			uni.showToast({
			    title: '加载中...',
			    icon: 'loading',
			    duration: 1000
			}); 
			let phone = uni.getStorageSync('phone');
			
			this.phone=phone
			this.login()
			
		},
		onReachBottom() {

		},
		methods: {
			// 开始登录
			login: function () {
				var _self=this
			    uni.request({
			        method: 'POST',
			        url: 'https://jizhang.xqyu.cn/index.php/api/index/login',
			        dataType: 'json',
			        header: {
			            'content-type': 'application/x-www-form-urlencoded'
			        },
			        data: {
			            phone: _self.phone
			        },
			        success: function (res) {
						console.log('获取我的页面调用登录结果',res.data.data[0].score_sum)
			            if (res.data.code == 1) {
							_self.jizhang_score=res.data.data[0].jizhang_score
							_self.wenjuan_score=res.data.data[0].wenjuan_score
							_self.feedback_score=res.data.data[0].feedback_score
							_self.login_score=res.data.data[0].login_score
			            } else {
			               _self.jizhang_score=0
			               _self.wenjuan_score=0
			               _self.feedback_score=0
			               _self.login_score=0
			            }
			        },
			        fail: function (err) {
			          
			        }
			    });
			},

		}
	};
</script>

<style>
	/* page不能写带scope的style标签中，否则无效 */
	page {
		background-color: rgb(240, 240, 240);
	}
</style>

<style lang="scss" scoped>

</style>
